home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-wchcon.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  71 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                       S Y S T E M . W C H _ C O N                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package defines the codes used to identify the encoding method for
  27. --  wide characters in string and character constants. This is needed both
  28. --  at compile time and at runtime (for the wide character runtime routines)
  29.  
  30. package System.WCh_Con is
  31. pragma Pure (WCh_Con);
  32.  
  33.    type WC_Encoding_Method is range 0 .. 3;
  34.    --  Type covering the range of values used to represent wide character
  35.    --  encoding methods. An enumeration type might be a little neater, but
  36.    --  more trouble than it's worth, given the need to pass these values
  37.    --  from the compiler to the backend, and to record them in the ALI file.
  38.  
  39.    WCEM_Hex : constant WC_Encoding_Method := 0;
  40.    --       The wide character with code 16#abcd# is represented by the
  41.    --       escape sequence ESC a b c d (five characters, where abcd are
  42.    --       ASCII hex characters, using upper case for letters). This
  43.    --       method is easy to deal with in external environments that do
  44.    --       not support wide characters, and covers the whole BMP. This
  45.    --       is the default encoding method.
  46.  
  47.    WCEM_Upper : constant WC_Encoding_Method := 1;
  48.    --       The wide character with encoding 16#abcd#, where the upper bit
  49.    --       is on (i.e. a is in the range 8-F) is represented as two bytes
  50.    --       16#ab# and 16#cd#. The second byte may never be a format control
  51.    --       character, but is not required to be in the upper half. This
  52.    --       method can be also used for shift-JIS or EUC where the internal
  53.    --       coding matches the external coding.
  54.  
  55.    WCEM_Shift_JIS : constant WC_Encoding_Method := 2;
  56.    --       A wide character is represented by a two character sequence
  57.    --       16#ab# and 16#cd#, with the restrictions described for upper
  58.    --       half encoding as described above. The internal character code
  59.    --       is the corresponding JIS character according to the standard
  60.    --       algorithm for Shift-JIS conversion. See the body of package
  61.    --       System.JIS_Conversions for further details.
  62.  
  63.    WCEM_EUC : constant WC_Encoding_Method := 3;
  64.    --       A wide character is represented by a two character sequence
  65.    --       16#ab# and 16#cd#, with both characters being in the upper half.
  66.    --       The internal character code is the corresponding JIS character
  67.    --       according to the EUC encoding algorithm. See the body of package
  68.    --       System.JIS_Conversions for further details.
  69.  
  70. end System.WCh_Con;
  71.